package com.example.minefieldkeepercloud.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.example.minefieldkeepercloud.R;
import com.example.minefieldkeepercloud.view.MyGridView;
import com.king.base.adapter.ViewHolderAdapter;
import com.king.base.adapter.holder.ViewHolder;

import java.util.ArrayList;
import java.util.List;

public class Madapter extends ViewHolderAdapter<String> {
    private Context context;
    private List<String> list_number;
    public Madapter(Context context, List<String> listData,List<String> list_number) {
        super(context, listData);
        this.context = context;
        this.list_number=list_number;
    }

    @Override
    public View buildConvertView(LayoutInflater layoutInflater, String string, int position) {
        return inflate(R.layout.adapter_mdd);
    }

    @Override
    public void bindViewDatas(ViewHolder holder, String bean, final int position) {
        String str[]=bean.split(" ");
        List<String> list=new ArrayList<>();
        for(int i=0;i<str.length;i++)
        {
            list.add(str[i]);
        }
        MyGridView gridview=holder.getView(R.id.gridview);
        Gadapter gadapter=new Gadapter(context,list);
        gridview.setAdapter(gadapter);
        holder.setText(R.id.tv_title,"主板"+(Integer.valueOf(list_number.get(position))+1));
    }
}
